<?php
//if not a real page (nobody called us here, just user trying to hack
if ((!isset($_SESSION['realpage']))
 || ($_SESSION['realpage'] == false))
 {
 	require './hack.php';
 	die(" ");
 }

error_reporting(E_ALL);


if (0 > version_compare(PHP_VERSION, '5')) {
	die('This file was generated for PHP 5');
}

class Post
{

	// --- ATTRIBUTES ---

	public $timestamp = null;

	public $Topic = null;
	
	public $Content = null;

	public $Visible = null;
	
	public $uid = null;
	
	public $fname = null;
	
	public $lname = null;
	
	public $pid = null;
	
	// --- OPERATIONS ---
	public static function factorPost($sqlArr)
	{
		
		$obj = new Post();     
		$flags = ENT_COMPAT | ENT_QUOTES ;
		$obj->uid			= $sqlArr['uid'];
		$obj->pid           = $sqlArr['pid'];
		$obj->timestamp     = $sqlArr['timestamp'];	  	  //meta
		$obj->lname 		= htmlspecialchars ( $sqlArr['lname'],$flags ,'UTF-8');
		$obj->fname 		= htmlspecialchars ( $sqlArr['fname'],$flags ,'UTF-8');
		$obj->Visible		= $sqlArr['visibility'];
		$obj->Topic	 		= htmlspecialchars ( $sqlArr['topic'],$flags ,'UTF-8');
		//$obj->Content 		= htmlspecialchars ( $sqlArr['content'],$flags ,'UTF-8');	
		
		$obj->Content = str_replace("[dropline]", '<br>', htmlspecialchars ( $sqlArr['content'],$flags ,'UTF-8'));
		
		return  $obj;	
	}
} /* end of class Post */

?>